﻿using ConfExpert.Forms.Base;
using DevExpress.XtraEditors.Repository;
using DevTeam;

using System;
namespace ConfExpert.Forms.Depo
{
    public partial class EtiketlenmeyenToplar : XForm
    {
        public EtiketlenmeyenToplar()
        {
            InitializeComponent();
        }

        private void EtiketlenmeyenToplar_Load(object sender, EventArgs e)
        {
            gridView1.Init("GetGiristeSetlenmemisToplar");
            gridView1.AddDetailGrid(gridView2, "YuklemeId");

            gridView1.MakeReadOnly();
            gridView2.MakeReadOnly();

            //gridView1.SutunEkle("exp", typeof(int), "COUNT(Child({FK}).RollId)");

            gridView1.Columns["GelisTarihi"].ColumnEdit = new RepositoryItemDateEdit();
            ((RepositoryItemDateEdit)gridView1.Columns["GelisTarihi"].ColumnEdit).DisplayFormat.FormatString = "D";
            gridView1.FormatAsNumber(0, "Kalan", "Toplam");
            gridView2.FormatAsNumber(1, "Qty");

            gridView1.AddSummary("Kalan", "Toplam");
            gridView2.AddSummary("Qty");

            gridView1.FocusedRowChanged += gridView1_FocusedRowChanged;
            splitContainerControl1.AutoSize();
            
            gridView1.BestFitColumns();
            gridView2.BestFitColumns();
        }

        void gridView1_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
        {
            gridView2.BestFitColumns();
        }
    }
}
